function ref(value){
    return createRef(value)
}

function createRef(rawValue){
    return new RefImpl(rawValue)
}

class RefImpl {
    constructor(_rawValue){
        this._value = _rawValue
    }
    
    get value(){
        return this._value
    }
    
    set value(newVal){
        this._value = newVal
    }
}

let a = ref("123")
console.log(a.value)
a.value = "456"
console.log(a.value)